package net.thxjj.adminServer.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.mongodb.core.mapping.Document;

@Document(collection="th_login_handle_log")//集合名
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class LoginHadleEvent implements Comparable<LoginHadleEvent>{
    private long timestamp;
    private long userId;
    private String deviceId;


    @Override
    public String toString() {
        return "LoginHadleEvent{" +
                "timestamp=" + timestamp +
                ", userId=" + userId +
                ", deviceId='" + deviceId + '\'' +
                '}';
    }

    @Override
    public int compareTo(LoginHadleEvent o) {
        return Long.compare(this.getTimestamp(), o.getTimestamp());
    }
}
